package com.xxmw.transaction.mapper.robot;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xxmw.transaction.model.robot.RobotOrder;
import com.xxmw.transaction.vo.SymbolVolumeVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author luowenliang
 * @since 2020/2/14 16:01
 */
public interface RobotOrderMapper extends BaseMapper<RobotOrder> {

    int updateExpected (RobotOrder order, @Param("expected") Integer expected);

    RobotOrder getMaxBuyPriceOrder (@Param("bourse") Integer bourse, @Param("symbol") String symbol);

    RobotOrder getMinSellPriceOrder (@Param("bourse") Integer bourse, @Param("symbol") String symbol);

    List<SymbolVolumeVo> volumeStatistics ();

    /**
     * CTC挂单数量统计
     * @param tradeType
     * @return
     */
    List<Map<String, Double>> ctcOrderNumCount (@Param("tradeType") Integer tradeType);

    /**
     * 手续费统计
     * @param symbolLike 'ctc%' '%usdt' ...
     * @param tradeType 3 4
     * @return
     */
    List<Map<String, Double>> feeCount (@Param("symbolLike") String symbolLike, @Param("tradeType") Integer tradeType);

//    /**
//     * 获取离指定时间最近的最新成交订单
//     * @param least
//     * @return
//     */
//    Map<String, Object> latestDealOrder (@Param("least") Date least);
//
//    /**
//     * 最近成交的10笔订单
//     * @return
//     */
//    List<Map<String, Object>> tenLatestDealOrder();
}
